import ajax from "./ajax"
import { VDT_CODE_URL } from "@/config/url.conf"

export function vdtCodeApi(phone) {
    return ajax({
        // url: '/user/validate/code',
        url: VDT_CODE_URL,
        method: 'post',
        data: { phone }
    })
}

export function loginApi(data) {
    return ajax({
        url: '/user/app/login',
        method: 'post',
        data
    })
}

export function autoLoginApi() {
    return ajax({
        url: '/user/auto/login',
        method: 'post'
    })
}

export function userInfoApi(id) {
    return ajax({
        url: '/user/info',
        params: { id }
    })
}

export function userRoleApi(ids) {
    return ajax({
        url: '/role/list/byids',
        params: { ids }
    })
}